package com.autumn.application.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.autumn.application.IApplicationModule;
import com.autumn.runtime.session.IAutumnSession;

/**
 * 应用服务抽象
 * 
 * @author 杨昌国
 *
 *         2017-09-22 20:50:37
 */
public abstract class AbstractApplicationService implements IApplicationService, IApplicationModule {

	/**
	 * 日志
	 */
	private final Log logger = LogFactory.getLog(this.getClass());

	private final String moduleId;

	/**
	 * 实例化 AbstractApplicationService 新实例
	 */
	public AbstractApplicationService() {
		this.moduleId = this.getClass().getCanonicalName();
	}

	/**
	 * 获取日志
	 * 
	 * @return
	 */
	@Override
	public final Log getLogger() {
		return this.logger;
	}

	@Autowired
	private IAutumnSession session;

	/**
	 * 获取会话
	 * 
	 * @return
	 */
	@Override
	public IAutumnSession getSession() {
		return this.session;
	}

	@Override
	public String getModuleId() {
		return this.moduleId;
	}
}
